package java111;

import java.util.Scanner;

public class Day19 {
    //https://www.nowcoder.com/practice/fe6c73cb899c4fe1bdd773f8d3b42c3d?tpId=122&tqId=33649&ru=/exam/oj
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int x = in.nextInt();
            int[] arr = new int[n];
            long res = x;
            for(int i = 0; i < n; i++){
                arr[i] = in.nextInt();
                if(arr[i] <= res){
                    res += arr[i];
                } else {
                    res += gcd(res, arr[i]);
                }
            }
            System.out.println(res);
        }
    }
    public static long gcd(long x, long y){
        if(y == 0){
            return x;
        }
        return gcd(y, x % y);
    }


    //https://www.nowcoder.com/practice/2237b401eb9347d282310fc1c3adb134?tpId=265&tqId=39288&ru=/exam/oj
    public int maxValue (int[][] grid) {
        // write code here
        int m = grid.length, n = grid[0].length;
        int[][] dp = new int[m+1][n+1];
        for(int i = 1; i < m+1; i++){
            for(int j = 1; j < n+1; j++){
                dp[i][j] = Math.max(dp[i-1][j], dp[i][j-1]) + grid[i-1][j-1];
            }
        }
        return dp[m][n];
    }

    //https://ac.nowcoder.com/acm/problem/214850
    public static void main3(String[] args){
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- > 0){
            int n = in.nextInt();
            String[] arr = new String[n];
            for(int i = 0; i < n; i++){
                arr[i] = in.next();
            }
            int left = 0, right = n-1;
            while(left < right){
                if(hasEqualsChar(arr[left], arr[right])){
                    left++;
                    right--;
                } else {
                    System.out.println("No");
                    break;
                }
            }
            if(left >= right){
                System.out.println("Yes");
            }
        }
    }
    public static boolean hasEqualsChar(String str1, String str2){
        boolean[] arr1 = new boolean[26];
        boolean[] arr2 = new boolean[26];
        for(int i = 0; i < str1.length(); i++){
            arr1[str1.charAt(i) -'a'] = true;
        }
        for(int i = 0; i < str2.length(); i++){
            arr2[str2.charAt(i) -'a'] = true;
        }
        for(int i = 0; i < 26; i++){
            if(arr1[i] && arr2[i]){
                return true;
            }
        }
        return false;
    }
}
